<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>享送小哥</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body>
    <div id="data-loading">
        <div class="loading1"><img src="../images/loading.gif"></div>
    </div>
    <div class="aui-content vue">
        <header class="aui-bar aui-bar-nav aui-bar-light u-aui-bar">
            <a href="javascript:api.closeWin();" class="aui-pull-left aui-btn"> <span class="aui-iconfont aui-icon-left"></span> </a>
            <div class="aui-title u-aui-title">消息中心</div>
        </header>
        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-media-list news-list">
                <li class="aui-list-item aui-list-item-middle" @click="toList('官方公告','notify')">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-media">
                            <img src="../images/news1.png" class="aui-img-round aui-list-img-sm">
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title">官方公告</div>
                                <div class="aui-list-item-right">{{notify.create_time}}</div>
                            </div>
                            <div class="aui-list-item-text aui-ellipsis-1">{{notify.content}}</div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" @click="toList('系统消息','system')">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-media">
                            <img src="../images/news2.png" class="aui-img-round aui-list-img-sm">
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title">系统消息</div>
                                <div class="aui-list-item-right">{{system.create_time}}</div>
                            </div>
                            <div class="aui-list-item-text aui-ellipsis-1">{{system.content}}</div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" @click="toList('订单消息','order')">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-media">
                            <img src="../images/news3.png" class="aui-img-round aui-list-img-sm">
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title">订单消息</div>
                                <div class="aui-list-item-right">{{order.create_time}}</div>
                            </div>
                            <div class="aui-list-item-text aui-ellipsis-1">{{order.content}}</div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript">
        apiready = function() {
            app.statusBar.set();

            vObj = new Vue({
                el: ".vue",
                data: {
                    notify: {},
                    system: {},
                    order: {}
                },
                methods: {
                    initMsg: function() {
                        app.request.get('Client/message', function(res) {
                            if (res.code == 200) {
                                vObj.notify = res.data.notify;
                                vObj.system = res.data.system;
                                vObj.order = res.data.order;
                                app.request.finish(vObj);
                            } else {
                                app.error(res.message);
                            }
                        });
                    },
                    toList: function(title, act) {
                        app.page({
                            name: 'message_list',
                            url: 'message_list.html',
                            pageParam: {
                                title: title,
                                act: act
                            }
                        })
                    }
                }
            });

            vObj.initMsg();
        }
    </script>
</body>

</html>
